{{include file="header.tpl"}}
<!--content-->
<div class="w1002">
<div class="borrow_ri">
<h2></h2>
<div class="borrow_lt_con">
<table width="95%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td width="21%" height="60" align="right">贷款金额：</td>
        <td width="79%"><input name="jsprime" type="text"  class="borrow_lt_set"/>元</td>
    </tr>
    <tr>
        <td height="60" align="right">年化利率：</td>
        <td><input name="jsinterest" type="text"  class="borrow_lt_set"/>%</td>
    </tr>
    <tr>
        <td height="60" align="right">还款方式：</td>
        <td>等额本息</td>
    </tr>
    <tr>
        <td height="60" align="right">借款方式：</td>
        <td>
            <select name="jstime" class="borrow_lt_set">
            <option value="1">一个月</option>
            <option value="3">三个月</option>
            <option value="6">六个月</option>
            <option value="12">12个月</option>
            <option value="24">24个月</option>
            <option value="36">36个月</option>
            </select></td>
    </tr>
    <tr>
        <td height="60" align="right">月还本息：</td>
        <td><input name="jsresult" type="text" value="" class="borrow_lt_set" readonly="readonly"/>
            万元</td>
    </tr>
    <tr>
        <td height="60" align="right">共还本息：</td>
        <td><input name="jsresultini" type="text" value="" class="borrow_lt_set" readonly="readonly"/>元
		</td>
    </tr>
    <tr>
        <td height="100" colspan="2"><input name="" type="submit" class="borrow_submit" value="计算器" onclick="jsbenxi();"/></td>
        </tr>
</table>
</div>
<div class="borrow_lt_bg"></div> 
</div>
<br class="Spacer1" />
</div>
<script type="text/javascript">
    function jsbenxi(){
        var jsprime = $("input[name='jsprime']").val();
        var jsinterest = $("input[name='jsinterest']").val();
        var jstime = $("select[name='jstime']").val();
        if(jsprime == ""){
            alert("请输入金额！");
            return false;
        }
        if(jsinterest == ""){
            alert("请输入贷款利率！");
            return false;
        }
        var jsresult;
        var jsresultini;
        var m=parseFloat(jsinterest)/1200;
        //
        var jm=1;
        for($i=0;$i<jstime;$i++){
            jm*=(1+parseFloat(m));
        }
        jsresult=parseFloat(jsprime)*parseFloat(m)+parseFloat(jsprime)*parseFloat(m)/(parseFloat(jm)-1);
        jsresultini=jsresult*jstime;
        jsresult=parseFloat(jsresult).toFixed(2);
        jsresultini=parseFloat(jsresultini).toFixed(2);
        $("input[name='jsresult']").attr("value",jsresult);
        $("input[name='jsresultini']").attr("value",jsresultini);
    }
</script>

{{include file="footer.tpl"}}